/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.comut.crud.pojo.user;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author asantos
 */
@XmlRootElement( )
@XmlAccessorType(XmlAccessType.FIELD)
public class User implements Serializable{
    
    private static final long serialVersionUID = 2132341;
    
    private int id = -1;
    //can be changed but must keep inside the same group
    private int id_sub_group = -1;
    private int id_role = -1;
    //can be changed but must be unique
    private String login= null;
    private String password= null;
    private String email= null;
    private String name= null;
    private String activation= null;
    private String expiration= null;
    private String email_status= null;
    private String token= null;
    private String tags=null;

    public String getActivation() {
        return activation;
    }

    public void setActivation(String activation) {
        this.activation = activation;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail_status() {
        return email_status;
    }

    public void setEmail_status(String email_status) {
        this.email_status = email_status;
    }

    public String getExpiration() {
        return expiration;
    }

    public void setExpiration(String expiration) {
        this.expiration = expiration;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId_role() {
        return id_role;
    }

    public void setId_role(int id_role) {
        this.id_role = id_role;
    }

    public int getId_sub_group() {
        return id_sub_group;
    }

    public void setId_sub_group(int id_sub_group) {
        this.id_sub_group = id_sub_group;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }
    

    @Override
    public String toString() {
        return "User{" + "id=" + id + ", id_sub_group=" + id_sub_group + ", id_role=" + id_role + ", login=" + login + ", password=" + password + ", email=" + email + ", name=" + name + ", activation=" + activation + ", expiration=" + expiration + ", email_status=" + email_status + ", token=" + token + ", tags=" + tags + '}';
    }
    
    public boolean isValid(){
        if(id_sub_group !=-1 && id_role !=-1 && login !=null && password != null && email != null && name !=null && email_status== null && tags == null)
            return true;
        return false;
    }
    
}
